package com.auxgroup.smarthome.job.peakvalley;

import com.auxgroup.smarthome.job.CommonScheduler;
import com.dangdang.ddframe.job.lite.api.JobScheduler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by kevinchen on 2017/9/14.
 * 峰谷节电控制指令下发
 */
@Configuration
public class AppPeakValleyControlSchuduler extends CommonScheduler{

    @Bean(initMethod = "init")
    public JobScheduler appPeakValleyControlJobSchuduler(final AppPeakValleyControlJob simpleJob,@Value("${peakValleyControlJob.jobName}") final String jobName,
                                                @Value("${peakValleyControlJob.cron}") final String cron,
                                                @Value("${peakValleyControlJob.shardingTotalCount}") final int shardingTotalCount,
                                                @Value("${peakValleyControlJob.shardingItemParameters}") final String shardingItemParameters) {
        return createJobScheduler(simpleJob,jobName,cron,shardingTotalCount,shardingItemParameters);
    }

}
